<?php

namespace Usuarios\Form;

use Zend\Form\Form;

class UsuarioForm extends Form {

   public function __construct($name = null) {

      //we want to ignore the name passed
      parent::__construct('Administración de Usuarios');
      $this->setAttribute('method', 'post');
      $this->add(array(
         'name' => 'id',
         'attributes' => array(
            'type' => 'hidden',
         ),
      ));
      $this->add(array(
         'type' => 'Zend\Form\Element\Checkbox',
         'name' => 'alumno',
         'options' => array(
                 'label' => 'Alumno ',
                 'checked_value' => 'on',
                 'unchecked_value' => 'off',
         )
      ));
      $this->add(array(
         'type' => 'Zend\Form\Element\Checkbox',
         'name' => 'profesor',
         'options' => array(
                 'label' => 'Profesor ',
                 'checked_value' => 'on',
                 'unchecked_value' => 'off',
         )
      ));
      $this->add(array(
         'type' => 'Zend\Form\Element\Checkbox',
         'name' => 'funcionario',
         'options' => array(
                 'label' => 'Funcionario ',
                 'checked_value' => 'on',
                 'unchecked_value' => 'off',
         )
      ));
      $this->add(array(
         'name' => 'username',
         'attributes' => array(
            'type' => 'text',
         ),
      ));
      $this->add(array(
         'name' => 'password',
         'attributes' => array(
            'type' => 'password',
         ),
      ));
      $this->add(array(
         'name' => 'password_confirm',
         'attributes' => array(
            'type' => 'password',
         ),
      ));
      $this->add(array(
         'name' => 'nombre',
         'attributes' => array(
            'type' => 'text',
         ),
      ));
      $this->add(array(
         'name' => 'apellido',
         'attributes' => array(
            'type' => 'text',
         ),
      ));
      /*$this->add(array(
         'name' => 'sexo',
         'attributes' => array(
            'type' => 'text',
         ),
      ));*/
      $this->add(array(
         'type' => 'Zend\Form\Element\Select',
         'name' => 'sexo',
         'attributes' => array(
            'id' => 'gender',
            'options' => array(
               'M' => 'Masculino',
               'F' => 'Femenino',
            ),
         ),
      ));
      $this->add(array(
         'name' => 'domicilio',
         'attributes' => array(
            'type' => 'text',
         ),
      ));
      $this->add(array(
         'name' => 'mail',
         'attributes' => array(
            'type' => 'text',
         ),
      ));
      $this->add(array(
         'name' => 'telefono',
         'attributes' => array(
            'type' => 'text',
         ),
      ));
      $this->add(array(
         'type' => 'Zend\Form\Element\Select',
         'name' => 'estado_civil',
         'attributes' => array(
            'id' => 'marital_status',
            'options' => array(
               'S' => 'Soltero',
               'C' => 'Casado',
            ),
         ),
      ));
      $this->add(array(
         'name' => 'fecha_nacimiento',
         'attributes' => array(
            'type' => 'text',
         ),
      ));
   /*   $this->add(array(
         'type' => 'Zend\Form\Element\Date',
         'name' => 'fecha_nacimiento',
         'attributes' => array(
            'min' => '1913-01-01',
            'max' => '2013-12-12',
            'step' => '1',
         )
      ));*/
/*      $this->add(array(
         'type' => 'Zend\Form\Element\Select',
         'name' => 'anho',
         'attributes' => array(
            'id' => 'year',
            'options' => array(
               '1913' => '1913', '1914' => '1914', '1915' => '1915', '1916' => '1916', '1917' => '1917',
               '1918' => '1918', '1919' => '1919', '1920' => '1920', '1921' => '1921', '1922' => '1922',
               '1923' => '1923', '1924' => '1924', '1925' => '1925', '1926' => '1926', '1927' => '1927',
               '1928' => '1928', '1929' => '1929', '1930' => '1930', '1931' => '1931', '1932' => '1932',
            ),
         ),
      ));
      $this->add(array(
         'type' => 'Zend\Form\Element\Select',
         'name' => 'mes',
         'attributes' => array(
            'id' => 'month',
            'options' => array(
               '01' => 'Enero', '02' => 'Febero', '03' => 'Marzo', '04' => 'Abril',
               '05' => 'Mayo', '06' => 'Junio', '07' => 'Julio', '08' => 'Agosto',
               '09' => 'Septiembre', '10' => 'Octubre', '11' => 'Noviembre', '12' => 'Diciembre',
            ),
         ),
      ));
      $this->add(array(
         'type' => 'Zend\Form\Element\Select',
         'name' => 'dia',
         'attributes' => array(
            'id' => 'day',
            'options' => array(
               '01' => '01', '02' => '02', '03' => '03', '04' => '04', '05' => '05', '06' => '06',
               '07' => '07', '08' => '08', '09' => '09', '10' => '10', '11' => '11', '12' => '12',
               '13' => '13', '14' => '14', '15' => '15', '16' => '16', '17' => '17', '18' => '18',
               '19' => '19', '20' => '20', '21' => '21', '22' => '22', '23' => '23', '24' => '24',
               '25' => '25', '26' => '26', '27' => '27', '28' => '28', '29' => '29', '30' => '30',
               '31' => '31',
            ),
         ),
      ));*/
      $this->add(array(
         'name' => 'lugar_nacimiento',
         'attributes' => array(
            'type' => 'text',
         ),
      ));
      $this->add(array(
         'name' => 'nacionalidad',
         'attributes' => array(
            'type' => 'text',
         ),
      ));
      $this->add(array(
         'name' => 'submit',
         'attributes' => array(
            'type' => 'submit',
            'value' => 'Go',
            'id' => 'submitbutton',
         ),
      ));
   }
}
